import { useSelector } from "react-redux";
import ReduxDemoCom from "./ReduxDemoCom";

import {store} from "@/store/store";
 
export default function ReduxDemo() {


  //读取token
    const tokenaa = store.getState().token;
   console.log(77,tokenaa);

   //修改 store 
   //store.dispatch({type:"token",payload:"token"});
 
       
  

   let token= useSelector((state:any)=>state.token)

   let userInfo=useSelector((state:any)=>state.userInfo)
  return (
    <div>

        {token}
        <div>
            {userInfo.name}
        </div>
     
      <ReduxDemoCom></ReduxDemoCom>
    </div>
  );
}